Sea of nodes
a graph representation of SSA representation of a program that combines data flow and control flow, and relaxes the control flow from a total order to a partial order, keeping only the orderings required by data flow.
used as an IR in HotSpot, GraalVM, and V8's TurboFan JIT compiler.
Turbofan IR
https://docs.google.com/presentation/d/1Z9iIHojKDrXvZ27gRX51UxHD-bKf1QcPzSijntpMJBM/edit#slide=id.g19134d40cb_0_502
allows dead code elimination and constant propagation to be done together, which allows both optimizations to apply more often.
Cliff Clickが博士論文で提唱
(博士論文)https://www.researchgate.net/profile/Cliff-Click/publication/2394127_Combining_Analyses_Combining_Optimizations/links/0a85e537233956f6dd000000/Combining-Analyses-Combining-Optimizations.pdf
(論文)https://dl.acm.org/doi/pdf/10.1145/201059.201061
(サマリー)https://static.squarespace.com/static/50030e0ac4aaab8fd03f41b7/50030ec0e4b0c0ebbd07b0e0/50030ec0e4b0c0ebbd07b268/1281379125883/
例
code:Javascript
while(arg < 10) {
arg = arg + 1;
if (arg == 5)
continue;
if (arg == 6)
break;
}
return arg;
https://scrapbox.io/files/66779f0db298a0001d87acd5.svg
最適化の一例(Global value numbering)
(最適化前)
丸・黒矢印がデータの依存グラフ 四角・赤矢印は制御フローの依存グラフ
https://scrapbox.io/files/667785025505ec001ce5d926.svg
最適化後
https://scrapbox.io/files/6677850ad20d9c001dc05a9c.svg
チュートリアル
https://github.com/SeaOfNodes/Simple